package com.wb.test3;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.widget.LinearLayout;

import com.wb.test3.adapter.MainViewPagerAdapter;
import com.wb.test3.bean.TabBean;
import com.wb.test3.module.BaseFragment;
import com.wb.test3.widget.MainBottomTabLayout;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MainActivity extends BaseActivity {




    @Override
    protected int getLayoutId() {
        return R.layout.activity_main;
    }

    @Override
    protected void initView() {
        ViewPager vpMain = (ViewPager) findViewById(R.id.vp_main);
        MainBottomTabLayout tablayoutMain = (MainBottomTabLayout) findViewById(R.id.tablayout_main);



        //底部导航
        ArrayList<TabBean> tabMain = new ArrayList<>();
        tabMain.add(new TabBean("综合", 0, R.mipmap.ic_launcher, R.mipmap
                .ic_launcher));
        tabMain.add(new TabBean("动弹", 0, R.mipmap.ic_launcher, R.mipmap
                .ic_launcher));

        tabMain.add(new TabBean("发现", 0, R.mipmap.ic_launcher, R.mipmap
                .ic_launcher));
        tabMain.add(new TabBean("我的", 0, R.mipmap.ic_launcher, R.mipmap.ic_launcher));



        List<Fragment> fragments = new ArrayList<>();
        fragments.add(BaseFragment.newInstance());
        fragments.add(BaseFragment.newInstance());
        fragments.add(BaseFragment.newInstance());
        fragments.add(BaseFragment.newInstance());
        MainViewPagerAdapter adapter = new MainViewPagerAdapter(getSupportFragmentManager(),fragments);

        vpMain.setAdapter(adapter);


        tablayoutMain.setViewPager(vpMain,tabMain);



    }

    @Override
    protected void getData() {

    }

}
